package com.banach.prema.dto.vo;


import com.banach.prema.enums.SosStatus;
import com.banach.prema.enums.SosType;
import com.ego.framework.annotation.ResParam;
import org.apache.commons.lang3.StringUtils;

import java.time.LocalDateTime;

/**
 * 紧急情况
 * @author ajun
 *
 */
public class SosVO {
	@ResParam(label = "ID")
	private Long id;
	@ResParam(label = "类型",enumClass = SosType.class)
	private String type;//110,120,119
	@ResParam(label = "经度")
	private Double lat;//求救纬度
	@ResParam(label = "纬度")
	private Double lng;//求救经度

	@ResParam(label = "省份")
	private String province;//所属省份
	@ResParam(label = "城市")
	private String city;//所属城市
	@ResParam(label = "区划")
	private String district;//所属区划
	@ResParam(label = "区划代码")
	private String adcode;//所属区划代码
	@ResParam(label = "街道")
	private String street;//所属道路（街道）
	@ResParam(label = "街道号")
	private String streetNum;//街道号

	@ResParam(label = "求救人ID")
	private Long userId;//求救人

	@ResParam(label = "求救人")
	private String userName;//求救人

	@ResParam(label = "创建时间")
	private LocalDateTime createTime;//创建时间

	@ResParam(label = "更新时间")
	private LocalDateTime updateTime;//更新时间

	@ResParam(label = "结束时间")
	private LocalDateTime endTime;//结束时间

	@ResParam(label = "群组ID")
	private String groupId;//创建群组

	@ResParam(label = "状态",enumClass = SosStatus.class)
	private String status;//状态0为求救中，1为已结束

	
	public String getSimpleAddr(){
		String str = "";
		if(StringUtils.isNotEmpty(district)){
			str += district;
		}
		if(StringUtils.isNotEmpty(street)){
			str += street;
		}
		if(StringUtils.isNotEmpty(streetNum)){
			str += streetNum;
		}
		return str;
	}
	
	public String getFullAddr(){
		String str = "";
		if(StringUtils.isNotEmpty(province)){
			//str += province;
		}
		if(StringUtils.isNotEmpty(city)){
			str += city;
		}
		if(StringUtils.isNotEmpty(district)){
			str += district;
		}
		if(StringUtils.isNotEmpty(street)){
			str += street;
		}
		if(StringUtils.isNotEmpty(streetNum)){
			str += streetNum;
		}
		return str;
	}

	public Long getId() {
		return id;
	}

	public SosVO setId(Long id) {
		this.id = id;
		return this;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Double getLat() {
		return lat;
	}

	public void setLat(Double lat) {
		this.lat = lat;
	}

	public Double getLng() {
		return lng;
	}

	public void setLng(Double lng) {
		this.lng = lng;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getDistrict() {
		return district;
	}

	public void setDistrict(String district) {
		this.district = district;
	}

	public String getAdcode() {
		return adcode;
	}

	public void setAdcode(String adcode) {
		this.adcode = adcode;
	}

	public String getStreet() {
		return street;
	}

	public void setStreet(String street) {
		this.street = street;
	}

	public String getStreetNum() {
		return streetNum;
	}

	public void setStreetNum(String streetNum) {
		this.streetNum = streetNum;
	}

	public Long getUserId() {
		return userId;
	}

	public SosVO setUserId(Long userId) {
		this.userId = userId;
		return this;
	}

	public LocalDateTime getCreateTime() {
		return createTime;
	}

	public SosVO setCreateTime(LocalDateTime createTime) {
		this.createTime = createTime;
		return this;
	}

	public LocalDateTime getUpdateTime() {
		return updateTime;
	}

	public SosVO setUpdateTime(LocalDateTime updateTime) {
		this.updateTime = updateTime;
		return this;
	}

	public LocalDateTime getEndTime() {
		return endTime;
	}

	public SosVO setEndTime(LocalDateTime endTime) {
		this.endTime = endTime;
		return this;
	}

	public String getGroupId() {
		return groupId;
	}

	public SosVO setGroupId(String groupId) {
		this.groupId = groupId;
		return this;
	}

	public String getStatus() {
		return status;
	}

	public SosVO setStatus(String status) {
		this.status = status;
		return this;
	}

	public String getUserName() {
		return userName;
	}

	public SosVO setUserName(String userName) {
		this.userName = userName;
		return this;
	}
}
